package com.zjmzxfzhl.modules.purchase.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.zjmzxfzhl.common.base.BaseService;
import com.zjmzxfzhl.modules.purchase.controller.dto.PurchaseOrderDetailDto;
import com.zjmzxfzhl.modules.purchase.controller.vo.PurchaseOrderDetailVo;
import com.zjmzxfzhl.modules.purchase.entity.PurchaseOrderDetail;

import java.io.File;
import java.util.List;

/**
 * Service
 *
 * @author 庄金明
 */
public interface PurchaseOrderDetailService extends BaseService<PurchaseOrderDetail> {
    /**
     * 分页查询
     *
     * @param page
     * @param purchaseOrderDetail
     * @return
     */
    IPage<PurchaseOrderDetail> list(IPage<PurchaseOrderDetail> page, PurchaseOrderDetail purchaseOrderDetail);

    /**
     * 筛选查询设备审批单清单简略信息
     * @param dto
     * @return
     */
    List<PurchaseOrderDetailVo> listSimpleVoBy(PurchaseOrderDetailDto dto);

    /**
     * 筛选查询设备审批单清单详情
     * @param dto
     * @return
     */
    List<PurchaseOrderDetailVo> listBy(PurchaseOrderDetailDto dto);

    /**
     * 删除审批单清单
     * @param orderId
     */
    void deleteByOrderId(Long orderId);

    /**
     * 查询物料被审批单引用次数
     * @param materialId
     * @return
     */
    Integer countByMaterialId(Long materialId);

    /**
     * 查询物料在其他设备审批单中的使用清单
     * @param materialId
     * @param orderId
     * @return
     */
    List<PurchaseOrderDetail> listMaterialNotInOrder(Long materialId, Long orderId);

    /**
     * 批量导出设备审批单详情
     * @param detailDto
     * @return
     */
    File export(PurchaseOrderDetailDto detailDto);
}
